package cn.edu.nwsuaf.studentcenter.pojo;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * StudentCommonScore entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "student_common_score", catalog = "exam")
public class StudentCommonScore implements java.io.Serializable {

	// Fields

	private StudentCommonScoreId id;
	private Student student;
	private Cource cource;
	private Float score;

	// Constructors

	/** default constructor */
	public StudentCommonScore() {
	}

	/** full constructor */
	public StudentCommonScore(StudentCommonScoreId id, Student student,
			Cource cource, Float score) {
		this.id = id;
		this.student = student;
		this.cource = cource;
		this.score = score;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "studentNo", column = @Column(name = "student_no", nullable = false, length = 50)),
			@AttributeOverride(name = "courceNo", column = @Column(name = "cource_no", nullable = false, length = 50)) })
	public StudentCommonScoreId getId() {
		return this.id;
	}

	public void setId(StudentCommonScoreId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "student_no", nullable = false, insertable = false, updatable = false)
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cource_no", nullable = false, insertable = false, updatable = false)
	public Cource getCource() {
		return this.cource;
	}

	public void setCource(Cource cource) {
		this.cource = cource;
	}

	@Column(name = "score", nullable = false, precision = 12, scale = 0)
	public Float getScore() {
		return this.score;
	}

	public void setScore(Float score) {
		this.score = score;
	}

}